

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>Create Cliente</title>         
    </head>
    <body>
        <div class="nav">
           
            <span class="menuButton"><g:link class="list" action="list">Listar Clientes</g:link></span>
        </div>
        <div class="body">
            <h1>Novo Cliente</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${cliente}">
            <div class="errors">
                <g:renderErrors bean="${cliente}" as="list" />
            </div>
            </g:hasErrors>
            <g:form action="save" method="post" >
                <div class="dialog">
                    <table>
                        <tbody>
							<tr class="prop">
                                <td valign="top" class="name">
                                    <label for="nome">Nome:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:cliente,field:'nome','errors')}">
                                    <input type="text" id="cliente.nome" name="cliente.nome" value="${fieldValue(bean:cliente,field:'nome')}"/>
                                </td>
                            </tr> 
							
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="cnpj">Cnpj:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:cliente,field:'cnpj','errors')}">
                                    <input type="text" id="cliente.cnpj" name="cliente.cnpj" value="${fieldValue(bean:cliente,field:'cnpj')}"/>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="dataInclusao">Data Inclusao:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:cliente,field:'dataInclusao','errors')}">
                                    <g:datePicker precision="day" name="cliente.dataInclusao" value="${cliente?.dataInclusao}" ></g:datePicker>
                                </td>
                            </tr> 
                        
                                           
                                                
                            
                        
                        </tbody>
                    </table>
                </div>

		 <h2>Endereço</h2>
		 <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="rua">Rua:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:endereco,field:'rua','errors')}">
                                    <input type="text" id="endereco.rua" name="endereco.rua" value="${fieldValue(bean:endereco,field:'rua')}"/>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="numero">Numero:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:endereco,field:'numero','errors')}">
                                    <input type="text" id="endereco.numero" name="endereco.numero" value="${fieldValue(bean:endereco,field:'numero')}" />
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="complemento">Complemento:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:endereco,field:'complemento','errors')}">
                                    <input type="text" id="complemento" name="endereco.complemento" value="${fieldValue(bean:endereco,field:'complemento')}"/>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="bairro">Bairro:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:endereco,field:'bairro','errors')}">
                                    <input type="text" id="bairro" name="endereco.bairro" value="${fieldValue(bean:endereco,field:'bairro')}"/>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="cidade">Cidade:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:endereco,field:'cidade','errors')}">
                                    <g:select optionValue="nome" optionKey="id" from="${Cidade.list()}" name="endereco.cidade.id" value="${endereco?.cidade?.id}" ></g:select>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="uf">Uf:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:endereco,field:'uf','errors')}">
                                    <g:select optionValue="nome" optionKey="id" from="${Uf.list()}" name="endereco.uf.id" value="${endereco?.uf?.id}" ></g:select>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="cep">Cep:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:endereco,field:'cep','errors')}">
                                    <input type="text" id="endereco.cep" name="endereco.cep" value="${fieldValue(bean:endereco,field:'cep')}"/>
                                </td>
                            </tr> 
                        
                        </tbody>
                    </table>
                </div>


		<h2>Gerente</h2>
		<div class="dialog">
                    <table>
                        <tbody>
						
						 <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="nome">Nome:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:pessoa,field:'nomePessoa','errors')}">
                                    <input type="text" id="pessoa.nomePessoa" name="pessoa.nomePessoa" value="${fieldValue(bean:pessoa,field:'nomePessoa')}"/>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="cpf">Cpf:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:pessoa,field:'cpf','errors')}">
                                    <input type="text" id="pessoa.cpf" name="pessoa.cpf" value="${fieldValue(bean:pessoa,field:'cpf')}"/>
                                </td>
                            </tr> 
                        
                          
                        
                           
							
							  <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="dataNascimento">Data Nascimento:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:pessoa,field:'dataNascimento','errors')}">
                                    <g:datePicker precision="day" name="pessoa.dataNascimento" value="${pessoa?.dataNascimento}" ></g:datePicker>
                                </td>
                            </tr> 
                        
                        </tbody>
                    </table>
                </div>


                <div class="buttons">
                    <span class="button"><input class="save" type="submit" value="Salvar" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
